<!--
 * @Author: your name
 * @Date: 2021-09-10 09:27:46
 * @LastEditTime: 2021-09-10 09:42:57
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \briup\6-jQuery\day01\2-jQuery选择器.html
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
</head>

<body>
    <div id="app"></div>
    <p>1</p>
    <p>2</p>
    <p class="p3">3</p>
    <div class="p3"></div>
    <a href="http://www.baidu.com">百度一下</a>
    <a href="xxx">day day up</a>
</body>
<script>
    var app1 = document.getElementById("app");
    var app2 = $("#app")[0];
    console.log(app1);
    console.log(app2);
    //选取所有元素
    console.log($("*"));
    //根据元素名选取元素
    console.log($("p"));
    console.log($("div"));
    //根据类名进行选择
    console.log($(".p3")); //选择为类名为p3的元素
    //组合选择器
    console.log($("p.p3")); //选择类名为p3的段落p元素
    //根据属性进行选择[]  
    console.log($("[href]"));
    //选取某些属性为xxx的元素
    console.log($("[href='xxx']"));
    //选取子元素
    console.log($("p")[1]);
</script>

</html>